package com.example.devicemanage.service.impl;

import com.example.devicemanage.dao.UserMapper;
import com.example.devicemanage.entity.User;
import com.example.devicemanage.service.inter.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class UserServiceImp implements UserService {
    @Autowired
    UserMapper  userMapper;
    @Override
    public boolean login(User user) {
        int uid = user.getUid();

        //调用dao层查询数据库
        User user1 = userMapper.queryUserById(uid);
        if(user1 == null || !user1.getUname().equals(user.getUname()))
            return false;
        else
            return true;
    }


    }

